package com.company.cloud.behavior.modules.mgr.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.company.cloud.behavior.modules.base.entity.UserFollowInfo;
import com.company.cloud.behavior.modules.base.service.UserFollowInfoService;
import com.company.cloud.behavior.modules.mgr.controller.req.FavoriteMgrQuery4PageParam;
import com.company.cloud.common.asserts.ValidatorUtils;
import com.company.cloud.common.auth.annotation.Authc;
import com.company.cloud.common.bean.BaseResult;
import com.company.cloud.common.bean.LoginSimpleUserInfo;
import com.company.cloud.common.bean.LoginUserInfo;
import com.company.cloud.common.log.annotation.SysLog;
import com.company.cloud.common.utils.AuthContextUtils;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 关注管理
 */
@Authc
@RestController
@RequestMapping("/mgr/behavior/follow")
@Api(tags = "Mgr_Behavior_关注管理")
public class FollowMgrController {

    @Autowired
    private UserFollowInfoService userFollowInfoService;

    @PostMapping("/query")
    @SysLog("关注和收藏信息表列表查询")
    @ApiOperation(value = "关注和收藏信息表列表查询", response = BaseResult.class)
    public BaseResult query(@RequestBody FavoriteMgrQuery4PageParam params) {
        ValidatorUtils.validate(params);
        LoginSimpleUserInfo userInfo = AuthContextUtils.getUser();
//		IPage<FavoriteInfoModel> data= shopFavoriteMgrService.query(params,userInfo);
//		if(data==null) {
//			return  BaseResult.ok();
//		}
        return BaseResult.ok();
    }

    @GetMapping("/get")
    @SysLog("关注和收藏信息表详情")
    @ApiOperation(value = "关注和收藏信息表详情")
    public BaseResult get(@RequestParam("id") Integer id) {
        LoginSimpleUserInfo userInfo = AuthContextUtils.getUser();
        UserFollowInfo entity = userFollowInfoService.getById(id);
        return BaseResult.ok(entity);
    }

}
